<?php
$con=mysqli_connect("127.0.0.1","root","","morganse_crm");
//$con=mysqli_connect("127.0.0.1","root","","morganse_crm_sacc");
// Check connection
if (mysqli_connect_errno()) {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

$result = mysqli_query($con,"select * from crm_loancontract where app_id = '175347';");
//$result = mysqli_query($con,"select * from crm_loancontract where app_id = '29';");
//echo '<pre>';
$row = mysqli_fetch_array($result);

//print_r($row); exit;
$signature = $row[33];

$result = mysqli_query($con,"select * from crm_applicationcontact where app_id = '175347';");
$row = mysqli_fetch_array($result);
//print_r($row); 
$pic = str_replace(' ', '+', $signature);
/*
mysqli_query($con, "UPDATE `sacc_verificationstatus` SET  `contractprepared` =  '1',
`contractsigned` =  '0' WHERE `app_id` = 175347;");
*/
mysqli_close($con);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Signature Show</title>
</head>
<body>
<div id="show_sign_image"></div>

<div id="sigcode1" style="display:none;"></div>
<script src="http://www.maxcash.com.au/account/libs/jquery.js"></script>
<!--<script src="http://www.maxcash.com.au/account/libs/jSignature.min.noconflict.js"></script>-->
<script>
$(document).ready(function() {
						   var data = <?php echo trim($pic); ?>; 
	//var data = <?php //echo trim($pic); ?>; 
	var picture = $("#show_sign_image");
	var i = new Image()
		i.src = data;	
		$(i).appendTo(picture);
		
		
	
	
})
</script>
</body>
</html>
